package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.DeclarationBrandReport;
import com.ruoyi.system.mapper.DeclarationBrandReportMapper;
import com.ruoyi.system.service.IDeclarationBrandReportService;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

/**
 * 品牌报表Service业务层处理
 * 
 * @author triangle
 * @date 2022-07-31
 */
@Service
public class DeclarationBrandReportServiceImpl implements IDeclarationBrandReportService
{
    @Autowired
    private DeclarationBrandReportMapper declarationBrandReportMapper;

    /**
     * 查询品牌报表
     * 
     * @param decId 品牌报表主键
     * @return 品牌报表
     */
    @Override
    public DeclarationBrandReport selectDeclarationBrandReportByDecId(Long decId)
    {
        return declarationBrandReportMapper.selectDeclarationBrandReportByDecId(decId);
    }

    /**
     * 查询品牌报表列表
     * 
     * @param declarationBrandReport 品牌报表
     * @return 品牌报表
     */
    @Override
    public List<DeclarationBrandReport> selectDeclarationBrandReportList(DeclarationBrandReport declarationBrandReport)
    {
        return declarationBrandReportMapper.selectDeclarationBrandReportList(declarationBrandReport);
    }

    /**
     * 新增品牌报表
     * 
     * @param declarationBrandReport 品牌报表
     * @return 结果
     */
    @Override
    public int insertDeclarationBrandReport(DeclarationBrandReport declarationBrandReport)
    {
        declarationBrandReport.setCreateTime(DateUtils.getNowDate());
        return declarationBrandReportMapper.insertDeclarationBrandReport(declarationBrandReport);
    }

    /**
     * 修改品牌报表
     * 
     * @param declarationBrandReport 品牌报表
     * @return 结果
     */
    @Override
    public int updateDeclarationBrandReport(DeclarationBrandReport declarationBrandReport)
    {
        declarationBrandReport.setUpdateTime(DateUtils.getNowDate());
        return declarationBrandReportMapper.updateDeclarationBrandReport(declarationBrandReport);
    }

    /**
     * 批量删除品牌报表
     * 
     * @param decIds 需要删除的品牌报表主键
     * @return 结果
     */
    @Override
    public int deleteDeclarationBrandReportByDecIds(String decIds)
    {
        return declarationBrandReportMapper.deleteDeclarationBrandReportByDecIds(Convert.toStrArray(decIds));
    }

    /**
     * 删除品牌报表信息
     * 
     * @param decId 品牌报表主键
     * @return 结果
     */
    @Override
    public int deleteDeclarationBrandReportByDecId(Long decId)
    {
        return declarationBrandReportMapper.deleteDeclarationBrandReportByDecId(decId);
    }
}
